package com.prj.ufdm.file.dao;

import java.util.List;

import org.springframework.web.multipart.MultipartFile;
import com.mongodb.client.gridfs.model.GridFSFile;
import com.mongodb.DBObject;

public interface AloneFileGridFsDao {
	
	/**
	 * DESC:保存上传附件及元信息
	 * @param file
	 * @param metaData
	 * @return
	 * @throws Exception
	 */
	public GridFSFile storeGridFs(MultipartFile file,DBObject metaData) throws Exception;
	
	/**
	 * DESC:根据元文件的MD5查询所有的切片文件
	 * @param metaMd5
	 * @return
	 * @throws Exception
	 */
	public GridFSFile findGridFsByFileHash(String fileHash) throws Exception;
	
	
	/**
	 * DESC:根据 wholeFileHash 获取所有 GridFSFile
	 * @param wholeFileHash
	 * @return
	 * @throws Exception
	 */
	public List<GridFSFile> findAllGridFsByWholeFileHash(String wholeFileHash) throws Exception;
	
	/**
	 * DESC:根据 wholeFileId 获取所有 GridFSFile
	 * @param wholeFileId 
	 * @return
	 * @throws Exception
	 */
	public List<GridFSFile> findAllGridFsByWholeFileId(String wholeFileId) throws Exception;
	
	
	
}
